<?php

namespace App\Models;

use App\Services\CommonService;
use App\Services\EducationService;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Testing\Fluent\Concerns\Has;

class BillReport extends Model
{
     use HasFactory;
    protected $table = 'sp_bill_report';
    protected $primaryKey = 'id';
    public $timestamps = false;
    //查询地区信息


    public static function query($cert_name,$cert_no,$mobile)
    {
        $res=self::where('idcard',$cert_no)->OrWhere('account',$mobile)->where('name',$cert_name)->get();
        return obToArray($res);
    }

    public static function insertReport($report)
    {
        $data=[];
        $data['create_time']=time();
        $data['subject']=$report['subject'];
        $data['receiver']=$report['receiver'];
        $data['reportURL']=$report['reportURL'];
        $data['type']=$report['type'];
        $data['url']=$report['url'];
        $data['sendTime']=$report['sendTime'];
        $data['idcard']=$report['idcard'];
        $data['name']=$report['name'];
        $data['from']=$report['from'];
        $data['nickname']=$report['nickname'];
        $data['mailId']=$report['mailId'];
        $data['account']=$report['account'];
        return self::insert($data);

    }



}
